cmake_minimum_required(VERSION 3.5)#最低CMake版本
set(CMAKE_CXX_STANDARD 17)
project (database)# 工程名

#set(DATABASE_THIRDPARTY_LIBS fmt)
#target_link_libraries(${DATABASE_THIRDPARTY_LIBS})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}  -g -ggdb3") #

set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O0")



set(SOURCES
    src/buffer/buffer_pool_manager.cpp
    src/buffer/lru_replacer.cpp
    src/catalog/column.cpp
    src/catalog/schema.cpp
    src/common/config.cpp
    src/storage/disk/disk_manager.cpp
    src/type/type.cpp
    src/engine/main.cpp
)



FILE(GLOB_RECURSE ALL_SRC src/*.cpp )

MESSAGE( STATUS "this var key = ${ALL_SRC}.")


add_executable(database ${ALL_SRC})#用所有的源文件生成一个可执行文件


#include_directories(${PROJECT_SOURCE_DIR}/include)

target_include_directories(database
    PUBLIC 
        ${PROJECT_SOURCE_DIR}/include
        /usr/local/include 
        SYSTEM
)#设置这个可执行文件需要包含的库的路径
target_link_libraries(database /usr/local/lib/libjsoncpp.a)

